public class project {
    public int maxNumberOfBalloons(String text) {
        int[] arr=new int[26];
        String str="balon";
        for(char ch : text.toCharArray()){
            arr[ch-'a']++;
        }
        int ret=arr[str.charAt(0)-'a'];
        for(int i=0;i<str.length();i++){
            char ch=str.charAt(i);
            if(ch=='l'||ch=='o'){
                ret=Math.min(ret,arr[ch-'a']/2);
            }else{
                ret=Math.min(ret,arr[ch-'a']);
            }
        }
        return ret;
    }
}
class CustomStack {
    int[] arr;
    int size;
    int max;
    public CustomStack(int maxSize) {
        arr=new int[maxSize];
        size=0;
        max=maxSize;
    }

    public void push(int x) {
        if(size==max){
            return;
        }
        arr[size]=x;
        size++;
    }

    public int pop() {
        if(size==0){
            return -1;
        }
        int tmp=arr[size-1];
        arr[size-1]=0;
        size--;
        return tmp;
    }

    public void increment(int k, int val) {
        for(int i=0;i<Math.min(k,size);i++){
            arr[i]+=val;
        }
    }
}
